package com.weiyi.servlet05;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


@WebServlet("/hello.do")
public class SimpleModel extends HttpServlet{
	private HelloModel model = new HelloModel();
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		String user = req.getParameter("user");
		String message = model.doHello(user);
		req.setAttribute("message",message);
		req.getRequestDispatcher("hello.view").forward(req, resp);
	}
}
